<template>
    <el-select v-model="selectedVal" clearable class="filter-item" placeholder="系统类型" style="width: 120px;">
        <el-option
                v-for="(item, index) in os"
                :key="index"
                :label="item.label"
                :value="item.value">
        </el-option>
    </el-select>
</template>

<script>
    export default {
        // name: "source",
        props: ['value'],
        data () {
            return {
                selectedVal: '',
                os: this.$store.state.backend.options.os,
            };
        },
        watch: {
            value() {
                this.syncForm();
            },
            selectedVal() {
                this.$emit('input', this.selectedVal);
            }
        },
        methods: {
            syncForm() {
                this.selectedVal = this.value;
            },
        },
        created() {
            this.syncForm();
        }
    }
</script>

<style scoped>

</style>
